package com.baidu.yyb.dataBase;

import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;


import com.baidu.yyb.constant.StringName;
import com.lt.utils.Activity.AndroidConfig;


/**
 * @author LiuTong
 */
public class DbHelper extends SQLiteOpenHelper {

    private static final String TAG = "DbHelper";

    public DbHelper() {
        super(AndroidConfig.getInstance().getAppContext(), StringName.DB_NAME, null, StringName.DB_VERSION);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL(StringName.CREATE_NOTES_CONTENT);
        db.execSQL(StringName.CREATE_USER_TABLE);
        db.execSQL(StringName.CREATE_DEL_TABLE);
        Log.d(TAG, "创建数据库");

    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        if (oldVersion != newVersion) {
         Log.d(TAG, "升级数据库");
        }
    }

}
